package cn.com.jcoo;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class AuthCheckAutoConfiguration {

    @Bean
    @ConditionalOnBean(AccessService.class)
    public AccessAuthAspect accessAuthAspect(AccessService accessService) {
        return new AccessAuthAspect(accessService);
    }

    @Bean
    @ConditionalOnBean(DataAuthValidService.class)
    public DataAuthContext dataAuthContext() {
        return new DataAuthContext();
    }
}
